using OracleInternal.Common;

namespace OracleInternal.ConnectionPool
{
	internal static class RLBManager
	{
		private static SyncDictionary<string, RLB> m_rlbData = new SyncDictionary<string, RLB>();

		public static RLB Put(string message)
		{
			RLB rLB = new RLB(message);
			RLB result = null;
			if (rLB.m_bStatus)
			{
				RLB rLB2 = m_rlbData[rLB.m_id];
				if (rLB2 == null || rLB2.m_dateTime.CompareTo(rLB.m_dateTime) <= 0)
				{
					m_rlbData[rLB.m_id] = rLB;
					result = rLB;
				}
			}
			return result;
		}

		public static RLB Get(string id)
		{
			return m_rlbData[id];
		}

		public static void InvalidateRLBData(string id)
		{
			m_rlbData[id] = null;
		}
	}
}
